package com.baibei.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ExpandableListView;

/**
 * Created by tang on 2018/5/30.
 */

/**
 * 不会滚动的expandablelistview，是为了防止和外面包裹的scrollview发生滚动冲突，所以设置expandablelistview不会内部滚动，
 * 只会随着scrollview一起滚动。
 */

public class NestedExpandableListview extends ExpandableListView {
    public NestedExpandableListview(Context context) {
        super(context);
    }

    public NestedExpandableListview(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public NestedExpandableListview(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }
    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,

                MeasureSpec.AT_MOST);

        //将重新计算的高度传递回去
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
